Release 10.1A: OpenEdge Reporting:
Query/Results for UNIX
Determining files and selection criteria
Use the following shared variables in your Progress procedures to determine the files and selection criteria defined when the user selects the User module:
When using these shared variables:
- Results currently supports up to five joins between files in all modules.
- Results sets each unused array entry to contain an empty string (
“”) and places it at the end of the array so that no gaps appear in theqbf-fileandqbf-dbarrays. For example,qbf-file[1] = “customer” qbf-file[2] = “” qbf-file[3] = “order”cannot process because there is an unused entry (shown as "") between array entries one and three. Instead, the array containsqbf-file[1] = “customer” qbf-file[2] = “order”, where the unused entry appears at the end of the array.- The
WHEREclauses contained in theqbf-wherevariable can be blank or contain theWHEREexpression. The value contained within each array element does not begin with the keyword “WHERE.” If theqbf-whereelement is blank, it means that there is noWHEREcriteria for the corresponding file. (However, there might be a corresponding relation inqbf-of.)The
qbf-where[ ] variable might also contain the questions for Ask mode. (These are the prompts users see when they run aWHEREclause that uses Ask mode. They prompt users for a value at runtime.) IfINDEX(qbf-where[ ],"~{~{")is greater than0, then you must do additional processing before you can use theWHEREclause.For example, Results stores the run-time ask information in the
WHEREclause between double sets of curly braces {{ and }}. To use theWHEREclause, everything from{{ to }} inclusive must be replaced with a literal value.Between these braces, Results stores several fields: the data type (followed by a comma), the field name (followed by a comma), a relational operator (followed by a colon), and the user question. For example,
qbf-where[1] for the customer file might contain this code:
This means, “Extract all records where the field
sports.customer.Stis equal to a user-suppliedcharactervalue, and prompt the user with the questionEnter state for report. Then place the user-supplied value intoqbf-where[] in the place ofcharacter...report.- The
OFclause stores the relation. It begins withOForWHERE, except forqbf-of[1], which is usually empty. You can use the following code to combine theqbf-ofandqbf-wherevariables:
Note: Code similar to this is used in theu-export.psample export format program in the "Designing your own export format" section.Use this program listing in conjunction with the
qbf-file,qbf-where, andqbf-ofshared variables to produce a Progress 4GL selection statement similar to the following:
This program is important because you use these entry points to determine the files and selection criteria already defined when the User module was selected. Note that when there is a join operation, Results shows all parent relationships, not just the immediate parents.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |